/** Progetto PRAISED **/
package it.uniroma3.dia.praised.brenda.main;

import it.uniroma3.dia.praised.brenda.crawler.CrawlerBrenda;
import it.uniroma3.dia.praised.exception.MainException;

import java.net.MalformedURLException;
import java.net.URL;

/**
 * Main: Classe principale dalla quale viene lanciata l'esecuzione del Crawler
 * 
 * @author Accosta Augusto
 * @author Lopez Elisabetta
 *
 */
public class Main {
	
	public Main() {
		try {
			
			long start = System.currentTimeMillis();
			
			System.out.println("INIZIALIZZAZIONE APPLICAZIONE ...");
			
			URL url = new URL("http://www.brenda-enzymes.org/information/all_enzymes.php4");
			
			CrawlerBrenda crawler = new CrawlerBrenda(url);
			crawler.startup();
			
			long end = System.currentTimeMillis();
			System.out.println("Tempo esecuzione: " + (end-start) + " ms");
			
		} catch (MainException e) {
			System.err.println(e.getMessage());
		} catch (MalformedURLException e) {
			System.err.println(e.getMessage());
		}
	}

	public static void main(String[] args) throws Exception {
		@SuppressWarnings("unused")
		Main main = new Main();
	}

}
